//
//  GBAboutUsViewController.m
//  警用舆情平台
//
//  Created by 郭斌 on 15/5/13.
//  Copyright (c) 2015年 魏强. All rights reserved.
//

#import "GBAboutUsViewController.h"

@interface GBAboutUsViewController ()
{
    UILabel *labbel; 
}

@end

@implementation GBAboutUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //计算label的高度
    self.title = @"关于我们";
    self.view.backgroundColor = WQColor(241, 243, 244);
    self.navigationItem.backBarButtonItem.title = @"关于我们";
    //初始化主界面
    [self createView];
    // Do any additional setup after loading the view.
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;
    
}
- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    self.navigationController.navigationBar.hidden = YES;
    
}
#pragma mark - 初始化主界面
-(void)createView
{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(screenW / 2.0 - 35, 100 - 64, 70, 70)];
    imageView.image = [UIImage imageNamed:@"aboutUs"];
    
    labbel = [[UILabel alloc] initWithFrame:CGRectMake(screenW / 2.0 - 20, 175 - 64, 100, 40)];
    labbel.text = @"科盾科技";
    labbel.textAlignment = NSTextAlignmentCenter;
    labbel.centerX = self.view.centerX;
    labbel.font = [UIFont systemFontOfSize:17];
    labbel.textColor = WQColor(0, 153, 52);
    
    [self.view addSubview:imageView];
    [self.view addSubview:labbel];
    
    UIView *connectView = [[UIView alloc] initWithFrame:CGRectMake(0, 330 - 164, screenW, 40)];
    connectView.backgroundColor = [UIColor whiteColor];
    
    UILabel *renew = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 100, 30)];
    renew.text = @"检查更新:";
    renew.textColor = [UIColor lightGrayColor];
    
    UILabel *renew2 = [[UILabel alloc] initWithFrame:CGRectMake(screenW - 150, 5, 110, 30)];
    renew2.text = @"当前版本为1.0";
    renew2.textColor = [UIColor lightGrayColor];
    
    UIImage *image = [UIImage imageNamed:@"ic_point_right"];
    UIImageView *rightRowIv = [[UIImageView alloc]initWithImage:image];
    rightRowIv.width = image.size.width;
    rightRowIv.y = renew2.y+ (renew2.height - rightRowIv.height) *0.5;
    rightRowIv.x = CGRectGetMaxX(renew2.frame) + 8;
    
    rightRowIv.height = image.size.height;
    UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, screenW, 0.5)];
    line.backgroundColor = WQColor(241, 243, 244);
    
    UILabel *connectLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 100, 30)];
    connectLabel.text = @"客服热线:";
    connectLabel.textColor = [UIColor lightGrayColor];
    
    UIButton *numberBtn = [UIButton buttonWithType:0];
    numberBtn.frame = CGRectMake(screenW - 150, 5, 130, 30);
    [numberBtn addTarget:self action:@selector(CallTheCompany) forControlEvents:UIControlEventTouchUpInside];
    [numberBtn setTitle:@"400-830-8444" forState:UIControlStateNormal];
    [numberBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    
    //[connectView addSubview:renew];
    //[connectView addSubview:renew2];
    //[connectView addSubview:rightRowIv];
    [connectView addSubview:line];
    [connectView addSubview:connectLabel];
    [connectView addSubview:numberBtn];
    
    UILabel *numberLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(screenW / 2.0 - 120, 275, 240, 30)];
    numberLabel2.font = [UIFont boldSystemFontOfSize:16];
    numberLabel2.textAlignment = NSTextAlignmentCenter;
    numberLabel2.text = @"清朗大数据，您的数据搜索专家";
    numberLabel2.textColor = WQColor(95, 96, 97);
    
    UILabel *numberLabel3 = [[UILabel alloc] initWithFrame:CGRectMake(screenW / 2.0 - 120, 310, 240, 30)];
    numberLabel3.font = [UIFont boldSystemFontOfSize:13];
    numberLabel3.textAlignment = NSTextAlignmentCenter;
    numberLabel3.text = @"深圳市科盾科技有限公司";
    numberLabel3.textColor = [UIColor lightGrayColor];
    
    UILabel *numberLabel4 = [[UILabel alloc] initWithFrame:CGRectMake(screenW / 2.0 - 120, 335, 240, 30)];
    numberLabel4.font = [UIFont boldSystemFontOfSize:13];
    numberLabel4.textAlignment = NSTextAlignmentCenter;
    numberLabel4.text = @"Copyright@2015 szkedun.cn";
    numberLabel4.textColor = [UIColor lightGrayColor];
    
    UILabel *numberLabel5 = [[UILabel alloc] initWithFrame:CGRectMake(screenW / 2.0 - 120, 360, 240, 30)];
    numberLabel5.font = [UIFont boldSystemFontOfSize:13];
    numberLabel5.textAlignment = NSTextAlignmentCenter;
    numberLabel5.text = @"All Right Reserved";
    numberLabel5.textColor = [UIColor lightGrayColor];
    
    [self.view addSubview:numberLabel2];
    [self.view addSubview:numberLabel3];
    [self.view addSubview:numberLabel4];
    [self.view addSubview:numberLabel5];
    [self.view addSubview:connectView];
}


#pragma mark - 拨打电话
-(void)CallTheCompany
{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://4008308444"]];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
